<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="公司代码" prop="factoryCode">
        <el-input
          v-model="queryParams.factoryCode"
          placeholder="请输入公司代码"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="公司名称" prop="factoryName">
        <el-input
          v-model="queryParams.factoryName"
          placeholder="请输入公司名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="姓名" prop="name">
        <el-input
          v-model="queryParams.name"
          placeholder="请输入姓名"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="工号" prop="jobNo">
        <el-input
          v-model="queryParams.jobNo"
          placeholder="请输入工号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="部门" prop="department">
        <el-input
          v-model="queryParams.department"
          placeholder="请输入部门"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="分部" prop="branch">
        <el-input
          v-model="queryParams.branch"
          placeholder="请输入分部"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="组别" prop="pGroup">
        <el-input
          v-model="queryParams.pGroup"
          placeholder="请输入组别"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="岗位" prop="jobs">
        <el-input
          v-model="queryParams.jobs"
          placeholder="请输入岗位"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="入职日期" prop="entryDate">
        <el-date-picker clearable
          v-model="queryParams.entryDate"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择入职日期">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="实到天数" prop="actualDay">
        <el-input
          v-model="queryParams.actualDay"
          placeholder="请输入实到天数"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="节假日" prop="holidays">
        <el-input
          v-model="queryParams.holidays"
          placeholder="请输入节假日"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="正常加班" prop="workOvertime">
        <el-input
          v-model="queryParams.workOvertime"
          placeholder="请输入正常加班"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="拖班时间" prop="tbTime">
        <el-input
          v-model="queryParams.tbTime"
          placeholder="请输入拖班时间"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="实到小时" prop="actualHours">
        <el-input
          v-model="queryParams.actualHours"
          placeholder="请输入实到小时"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="休" prop="restDay">
        <el-input
          v-model="queryParams.restDay"
          placeholder="请输入休"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="假" prop="leaveDay">
        <el-input
          v-model="queryParams.leaveDay"
          placeholder="请输入假"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="轮" prop="lunDay">
        <el-input
          v-model="queryParams.lunDay"
          placeholder="请输入轮"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="新离职天数" prop="xlzDay">
        <el-input
          v-model="queryParams.xlzDay"
          placeholder="请输入新离职天数"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="应出勤天数" prop="ycqDay">
        <el-input
          v-model="queryParams.ycqDay"
          placeholder="请输入应出勤天数"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="备注" prop="reamrk">
        <el-input
          v-model="queryParams.reamrk"
          placeholder="请输入备注"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="某月1号" prop="lx1">
        <el-input
          v-model="queryParams.lx1"
          placeholder="请输入某月1号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="某月2号" prop="lx2">
        <el-input
          v-model="queryParams.lx2"
          placeholder="请输入某月2号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="某月3号" prop="lx3">
        <el-input
          v-model="queryParams.lx3"
          placeholder="请输入某月3号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="某月4号" prop="lx4">
        <el-input
          v-model="queryParams.lx4"
          placeholder="请输入某月4号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="某月5号" prop="lx5">
        <el-input
          v-model="queryParams.lx5"
          placeholder="请输入某月5号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="某月6号" prop="lx6">
        <el-input
          v-model="queryParams.lx6"
          placeholder="请输入某月6号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="某月7号" prop="lx7">
        <el-input
          v-model="queryParams.lx7"
          placeholder="请输入某月7号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="某月8号" prop="lx8">
        <el-input
          v-model="queryParams.lx8"
          placeholder="请输入某月8号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="某月9号" prop="lx9">
        <el-input
          v-model="queryParams.lx9"
          placeholder="请输入某月9号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="某月10号" prop="lx10">
        <el-input
          v-model="queryParams.lx10"
          placeholder="请输入某月10号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="某月11号" prop="lx11">
        <el-input
          v-model="queryParams.lx11"
          placeholder="请输入某月11号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="某月12号" prop="lx12">
        <el-input
          v-model="queryParams.lx12"
          placeholder="请输入某月12号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="某月13号" prop="lx13">
        <el-input
          v-model="queryParams.lx13"
          placeholder="请输入某月13号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="某月14号" prop="lx14">
        <el-input
          v-model="queryParams.lx14"
          placeholder="请输入某月14号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="某月15号" prop="lx15">
        <el-input
          v-model="queryParams.lx15"
          placeholder="请输入某月15号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="某月16号" prop="lx16">
        <el-input
          v-model="queryParams.lx16"
          placeholder="请输入某月16号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="某月17号" prop="lx17">
        <el-input
          v-model="queryParams.lx17"
          placeholder="请输入某月17号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="某月18号" prop="lx18">
        <el-input
          v-model="queryParams.lx18"
          placeholder="请输入某月18号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="某月19号" prop="lx19">
        <el-input
          v-model="queryParams.lx19"
          placeholder="请输入某月19号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="某月20号" prop="lx20">
        <el-input
          v-model="queryParams.lx20"
          placeholder="请输入某月20号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="某月21号" prop="lx21">
        <el-input
          v-model="queryParams.lx21"
          placeholder="请输入某月21号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="某月22号" prop="lx22">
        <el-input
          v-model="queryParams.lx22"
          placeholder="请输入某月22号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="某月23号" prop="lx23">
        <el-input
          v-model="queryParams.lx23"
          placeholder="请输入某月23号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="某月24号" prop="lx24">
        <el-input
          v-model="queryParams.lx24"
          placeholder="请输入某月24号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="某月25号" prop="lx25">
        <el-input
          v-model="queryParams.lx25"
          placeholder="请输入某月25号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="某月26号" prop="lx26">
        <el-input
          v-model="queryParams.lx26"
          placeholder="请输入某月26号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="某月27号" prop="lx27">
        <el-input
          v-model="queryParams.lx27"
          placeholder="请输入某月27号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="某月28号" prop="lx28">
        <el-input
          v-model="queryParams.lx28"
          placeholder="请输入某月28号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="某月29号" prop="lx29">
        <el-input
          v-model="queryParams.lx29"
          placeholder="请输入某月29号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="某月30号" prop="lx30">
        <el-input
          v-model="queryParams.lx30"
          placeholder="请输入某月30号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="某月31号" prop="lx31">
        <el-input
          v-model="queryParams.lx31"
          placeholder="请输入某月31号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['hr:eleAttend:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['hr:eleAttend:edit']"
        >修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['hr:eleAttend:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['hr:eleAttend:export']"
        >导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="eleAttendList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="公司代码" align="center" prop="factoryCode" />
      <el-table-column label="公司名称" align="center" prop="factoryName" />
      <el-table-column label="姓名" align="center" prop="name" />
      <el-table-column label="工号" align="center" prop="jobNo" />
      <el-table-column label="部门" align="center" prop="department" />
      <el-table-column label="分部" align="center" prop="branch" />
      <el-table-column label="组别" align="center" prop="pGroup" />
      <el-table-column label="岗位" align="center" prop="jobs" />
      <el-table-column label="入职日期" align="center" prop="entryDate" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.entryDate, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="实到天数" align="center" prop="actualDay" />
      <el-table-column label="节假日" align="center" prop="holidays" />
      <el-table-column label="正常加班" align="center" prop="workOvertime" />
      <el-table-column label="拖班时间" align="center" prop="tbTime" />
      <el-table-column label="实到小时" align="center" prop="actualHours" />
      <el-table-column label="休" align="center" prop="restDay" />
      <el-table-column label="假" align="center" prop="leaveDay" />
      <el-table-column label="轮" align="center" prop="lunDay" />
      <el-table-column label="新离职天数" align="center" prop="xlzDay" />
      <el-table-column label="应出勤天数" align="center" prop="ycqDay" />
      <el-table-column label="备注" align="center" prop="reamrk" />
      <el-table-column label="某月1号" align="center" prop="lx1" />
      <el-table-column label="某月2号" align="center" prop="lx2" />
      <el-table-column label="某月3号" align="center" prop="lx3" />
      <el-table-column label="某月4号" align="center" prop="lx4" />
      <el-table-column label="某月5号" align="center" prop="lx5" />
      <el-table-column label="某月6号" align="center" prop="lx6" />
      <el-table-column label="某月7号" align="center" prop="lx7" />
      <el-table-column label="某月8号" align="center" prop="lx8" />
      <el-table-column label="某月9号" align="center" prop="lx9" />
      <el-table-column label="某月10号" align="center" prop="lx10" />
      <el-table-column label="某月11号" align="center" prop="lx11" />
      <el-table-column label="某月12号" align="center" prop="lx12" />
      <el-table-column label="某月13号" align="center" prop="lx13" />
      <el-table-column label="某月14号" align="center" prop="lx14" />
      <el-table-column label="某月15号" align="center" prop="lx15" />
      <el-table-column label="某月16号" align="center" prop="lx16" />
      <el-table-column label="某月17号" align="center" prop="lx17" />
      <el-table-column label="某月18号" align="center" prop="lx18" />
      <el-table-column label="某月19号" align="center" prop="lx19" />
      <el-table-column label="某月20号" align="center" prop="lx20" />
      <el-table-column label="某月21号" align="center" prop="lx21" />
      <el-table-column label="某月22号" align="center" prop="lx22" />
      <el-table-column label="某月23号" align="center" prop="lx23" />
      <el-table-column label="某月24号" align="center" prop="lx24" />
      <el-table-column label="某月25号" align="center" prop="lx25" />
      <el-table-column label="某月26号" align="center" prop="lx26" />
      <el-table-column label="某月27号" align="center" prop="lx27" />
      <el-table-column label="某月28号" align="center" prop="lx28" />
      <el-table-column label="某月29号" align="center" prop="lx29" />
      <el-table-column label="某月30号" align="center" prop="lx30" />
      <el-table-column label="某月31号" align="center" prop="lx31" />
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['hr:eleAttend:edit']"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['hr:eleAttend:remove']"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改电子考勤对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="公司代码" prop="factoryCode">
          <el-input v-model="form.factoryCode" placeholder="请输入公司代码" />
        </el-form-item>
        <el-form-item label="公司名称" prop="factoryName">
          <el-input v-model="form.factoryName" placeholder="请输入公司名称" />
        </el-form-item>
        <el-form-item label="姓名" prop="name">
          <el-input v-model="form.name" placeholder="请输入姓名" />
        </el-form-item>
        <el-form-item label="工号" prop="jobNo">
          <el-input v-model="form.jobNo" placeholder="请输入工号" />
        </el-form-item>
        <el-form-item label="部门" prop="department">
          <el-input v-model="form.department" placeholder="请输入部门" />
        </el-form-item>
        <el-form-item label="分部" prop="branch">
          <el-input v-model="form.branch" placeholder="请输入分部" />
        </el-form-item>
        <el-form-item label="组别" prop="pGroup">
          <el-input v-model="form.pGroup" placeholder="请输入组别" />
        </el-form-item>
        <el-form-item label="岗位" prop="jobs">
          <el-input v-model="form.jobs" placeholder="请输入岗位" />
        </el-form-item>
        <el-form-item label="入职日期" prop="entryDate">
          <el-date-picker clearable
            v-model="form.entryDate"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择入职日期">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="实到天数" prop="actualDay">
          <el-input v-model="form.actualDay" placeholder="请输入实到天数" />
        </el-form-item>
        <el-form-item label="节假日" prop="holidays">
          <el-input v-model="form.holidays" placeholder="请输入节假日" />
        </el-form-item>
        <el-form-item label="正常加班" prop="workOvertime">
          <el-input v-model="form.workOvertime" placeholder="请输入正常加班" />
        </el-form-item>
        <el-form-item label="拖班时间" prop="tbTime">
          <el-input v-model="form.tbTime" placeholder="请输入拖班时间" />
        </el-form-item>
        <el-form-item label="实到小时" prop="actualHours">
          <el-input v-model="form.actualHours" placeholder="请输入实到小时" />
        </el-form-item>
        <el-form-item label="休" prop="restDay">
          <el-input v-model="form.restDay" placeholder="请输入休" />
        </el-form-item>
        <el-form-item label="假" prop="leaveDay">
          <el-input v-model="form.leaveDay" placeholder="请输入假" />
        </el-form-item>
        <el-form-item label="轮" prop="lunDay">
          <el-input v-model="form.lunDay" placeholder="请输入轮" />
        </el-form-item>
        <el-form-item label="新离职天数" prop="xlzDay">
          <el-input v-model="form.xlzDay" placeholder="请输入新离职天数" />
        </el-form-item>
        <el-form-item label="应出勤天数" prop="ycqDay">
          <el-input v-model="form.ycqDay" placeholder="请输入应出勤天数" />
        </el-form-item>
        <el-form-item label="备注" prop="reamrk">
          <el-input v-model="form.reamrk" placeholder="请输入备注" />
        </el-form-item>
        <el-form-item label="某月1号" prop="lx1">
          <el-input v-model="form.lx1" placeholder="请输入某月1号" />
        </el-form-item>
        <el-form-item label="某月2号" prop="lx2">
          <el-input v-model="form.lx2" placeholder="请输入某月2号" />
        </el-form-item>
        <el-form-item label="某月3号" prop="lx3">
          <el-input v-model="form.lx3" placeholder="请输入某月3号" />
        </el-form-item>
        <el-form-item label="某月4号" prop="lx4">
          <el-input v-model="form.lx4" placeholder="请输入某月4号" />
        </el-form-item>
        <el-form-item label="某月5号" prop="lx5">
          <el-input v-model="form.lx5" placeholder="请输入某月5号" />
        </el-form-item>
        <el-form-item label="某月6号" prop="lx6">
          <el-input v-model="form.lx6" placeholder="请输入某月6号" />
        </el-form-item>
        <el-form-item label="某月7号" prop="lx7">
          <el-input v-model="form.lx7" placeholder="请输入某月7号" />
        </el-form-item>
        <el-form-item label="某月8号" prop="lx8">
          <el-input v-model="form.lx8" placeholder="请输入某月8号" />
        </el-form-item>
        <el-form-item label="某月9号" prop="lx9">
          <el-input v-model="form.lx9" placeholder="请输入某月9号" />
        </el-form-item>
        <el-form-item label="某月10号" prop="lx10">
          <el-input v-model="form.lx10" placeholder="请输入某月10号" />
        </el-form-item>
        <el-form-item label="某月11号" prop="lx11">
          <el-input v-model="form.lx11" placeholder="请输入某月11号" />
        </el-form-item>
        <el-form-item label="某月12号" prop="lx12">
          <el-input v-model="form.lx12" placeholder="请输入某月12号" />
        </el-form-item>
        <el-form-item label="某月13号" prop="lx13">
          <el-input v-model="form.lx13" placeholder="请输入某月13号" />
        </el-form-item>
        <el-form-item label="某月14号" prop="lx14">
          <el-input v-model="form.lx14" placeholder="请输入某月14号" />
        </el-form-item>
        <el-form-item label="某月15号" prop="lx15">
          <el-input v-model="form.lx15" placeholder="请输入某月15号" />
        </el-form-item>
        <el-form-item label="某月16号" prop="lx16">
          <el-input v-model="form.lx16" placeholder="请输入某月16号" />
        </el-form-item>
        <el-form-item label="某月17号" prop="lx17">
          <el-input v-model="form.lx17" placeholder="请输入某月17号" />
        </el-form-item>
        <el-form-item label="某月18号" prop="lx18">
          <el-input v-model="form.lx18" placeholder="请输入某月18号" />
        </el-form-item>
        <el-form-item label="某月19号" prop="lx19">
          <el-input v-model="form.lx19" placeholder="请输入某月19号" />
        </el-form-item>
        <el-form-item label="某月20号" prop="lx20">
          <el-input v-model="form.lx20" placeholder="请输入某月20号" />
        </el-form-item>
        <el-form-item label="某月21号" prop="lx21">
          <el-input v-model="form.lx21" placeholder="请输入某月21号" />
        </el-form-item>
        <el-form-item label="某月22号" prop="lx22">
          <el-input v-model="form.lx22" placeholder="请输入某月22号" />
        </el-form-item>
        <el-form-item label="某月23号" prop="lx23">
          <el-input v-model="form.lx23" placeholder="请输入某月23号" />
        </el-form-item>
        <el-form-item label="某月24号" prop="lx24">
          <el-input v-model="form.lx24" placeholder="请输入某月24号" />
        </el-form-item>
        <el-form-item label="某月25号" prop="lx25">
          <el-input v-model="form.lx25" placeholder="请输入某月25号" />
        </el-form-item>
        <el-form-item label="某月26号" prop="lx26">
          <el-input v-model="form.lx26" placeholder="请输入某月26号" />
        </el-form-item>
        <el-form-item label="某月27号" prop="lx27">
          <el-input v-model="form.lx27" placeholder="请输入某月27号" />
        </el-form-item>
        <el-form-item label="某月28号" prop="lx28">
          <el-input v-model="form.lx28" placeholder="请输入某月28号" />
        </el-form-item>
        <el-form-item label="某月29号" prop="lx29">
          <el-input v-model="form.lx29" placeholder="请输入某月29号" />
        </el-form-item>
        <el-form-item label="某月30号" prop="lx30">
          <el-input v-model="form.lx30" placeholder="请输入某月30号" />
        </el-form-item>
        <el-form-item label="某月31号" prop="lx31">
          <el-input v-model="form.lx31" placeholder="请输入某月31号" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { listEleAttend, getEleAttend, delEleAttend, addEleAttend, updateEleAttend } from "@/api/hr/eleAttend";

export default {
  name: "EleAttend",
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 电子考勤表格数据
      eleAttendList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        factoryCode: null,
        factoryName: null,
        name: null,
        jobNo: null,
        department: null,
        branch: null,
        pGroup: null,
        jobs: null,
        entryDate: null,
        actualDay: null,
        holidays: null,
        workOvertime: null,
        tbTime: null,
        actualHours: null,
        restDay: null,
        leaveDay: null,
        lunDay: null,
        xlzDay: null,
        ycqDay: null,
        reamrk: null,
        lx1: null,
        lx2: null,
        lx3: null,
        lx4: null,
        lx5: null,
        lx6: null,
        lx7: null,
        lx8: null,
        lx9: null,
        lx10: null,
        lx11: null,
        lx12: null,
        lx13: null,
        lx14: null,
        lx15: null,
        lx16: null,
        lx17: null,
        lx18: null,
        lx19: null,
        lx20: null,
        lx21: null,
        lx22: null,
        lx23: null,
        lx24: null,
        lx25: null,
        lx26: null,
        lx27: null,
        lx28: null,
        lx29: null,
        lx30: null,
        lx31: null
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
      }
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询电子考勤列表 */
    getList() {
      this.loading = true;
      listEleAttend(this.queryParams).then(response => {
        this.eleAttendList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        id: null,
        factoryCode: null,
        factoryName: null,
        name: null,
        jobNo: null,
        department: null,
        branch: null,
        pGroup: null,
        jobs: null,
        entryDate: null,
        actualDay: null,
        holidays: null,
        workOvertime: null,
        tbTime: null,
        actualHours: null,
        restDay: null,
        leaveDay: null,
        lunDay: null,
        xlzDay: null,
        ycqDay: null,
        reamrk: null,
        lx1: null,
        lx2: null,
        lx3: null,
        lx4: null,
        lx5: null,
        lx6: null,
        lx7: null,
        lx8: null,
        lx9: null,
        lx10: null,
        lx11: null,
        lx12: null,
        lx13: null,
        lx14: null,
        lx15: null,
        lx16: null,
        lx17: null,
        lx18: null,
        lx19: null,
        lx20: null,
        lx21: null,
        lx22: null,
        lx23: null,
        lx24: null,
        lx25: null,
        lx26: null,
        lx27: null,
        lx28: null,
        lx29: null,
        lx30: null,
        lx31: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加电子考勤";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const id = row.id || this.ids
      getEleAttend(id).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改电子考勤";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.id != null) {
            updateEleAttend(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addEleAttend(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$modal.confirm('是否确认删除电子考勤编号为"' + ids + '"的数据项？').then(function() {
        return delEleAttend(ids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('hr/eleAttend/export', {
        ...this.queryParams
      }, `eleAttend_${new Date().getTime()}.xlsx`)
    }
  }
};
</script>
